package com.fqy.servlet;

import com.fqy.dao.PeopleDaoImpl;
import com.fqy.dao.impl.PeopleDao;
import com.fqy.entity.People;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;

public class SearchServlet extends HttpServlet {
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        PeopleDao peopleDao = new PeopleDaoImpl();
        List<String> list = peopleDao.selectAllPeople();
        resp.setCharacterEncoding("GBK");//编码方式
        PrintWriter out = resp.getWriter();
         for (String people : list) {
             out.println(people);
        }
    }
}
